/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2023/12/19
 * Time: 21:06
 */

#ifndef CES_CONFIG_DOC_H
#define CES_CONFIG_DOC_H
#include "Node.h"

namespace CES::Config {
    class Doc;
    using DocSPtr = std::shared_ptr<Doc>;
    using DocWPtr = std::weak_ptr<Doc>;

    class CONFIG_MODULE_EXPORT Doc
        : public Node
    {
    public:
        explicit Doc(std::string _key, std::string _value = "");

        Doc();

        virtual ~Doc() override = default;

        static DocSPtr FromFile(const std::string & source);

        bool ToFile(const std::string & _file, const std::string & _indent = "\t");

        NodeList Query(const std::string & _path);
    };

}// namespace Config

#endif//CES_CONFIG_DOC_H
